<template>
  <el-card>
    <el-button type="danger" @click="dialog = true">清空neo4j节点数据</el-button>

    <el-dialog v-model="dialog" width="20%">
      <div style="color: red">危险操作，请输入密码</div>
      <el-input placeholder="请输入密码" v-model="secretKey" type="password" show-password/>
      <template #footer>
          <el-button @click="dialog = false">取消</el-button>
          <el-button @click="handel">确定</el-button>
      </template>

    </el-dialog>
  </el-card>
</template>
<script setup>
import {ref} from 'vue'
import {cleanNeo4jApi} from '@/api/recommend.js'
import useMessage from "@/utils/useMessage.js";
const dialog = ref(false)
const secretKey = ref('admin123')


const handel = async ()=> {
  dialog.value = false

  const res = await cleanNeo4jApi(secretKey.value)
  useMessage(res)
}
</script>
<style scoped>

</style>